// Copyright (C) CompatibL Technologies LLC. All rights reserved.
// This code contains valuable trade secrets and may be used, copied,
// stored, or distributed only in accordance with a written license
// agreement and with the inclusion of this copyright notice. 

#region File Info
// File       : ScalesPredefiner.cs
// Description: ChordCreator.ScalesPredefiner component implementation.
// Package    : ChordCreator
//
#endregion

using System.Linq;
using ChordCreator.Services.ConfigurationServices;

namespace ChordCreator.Services
{
    /// <summary>
    /// Summary description for ScalesPredefiner.
    /// </summary>
    public class ScalesPredefiner
    {
        public string[] GetScaleNames()
        {
            return XmlConfiguration.Instance.Handlerer.PredefinedScales.Select(x => x.Name).ToArray();
        }

        public int[] GetDegreesByScale(string name)
        {
            return XmlConfiguration.Instance.Handlerer.PredefinedScales.Where(x => x.Name == name).Select(x => x.Degrees).Single();
        }
    }
}